// 自定义下载文件方法
export function downExcel(obj, fileName) {
    const a_node = document.createElement("a");
    a_node.download = fileName;
    if ("msSaveOrOpenBlob" in navigator) {
        window.navigator.msSaveOrOpenBlob(obj, fileName);
    } else {
        a_node.href = URL.createObjectURL(obj);
    }
    a_node.click();
    // 
    setTimeout(() => {
        URL.revokeObjectURL(obj);
    }, 2000);
},
// 文件流转换
export function s2ab(s) {
    if (typeof ArrayBuffer !== "undefined") {
        const buf = new ArrayBuffer(s.length);
        const view = new Uint8Array(buf);
        for (let i = 0; i != s.length; ++i) {
            view[i] = s.charCodeAt(i) & 0xff;
        }
        return buf;
    } else {
        const buf = new Array(s.length);
        for (let i = 0; i != s.length; ++i) {
            buf[i] = s.charCodeAt(i) & 0xff;
        }
        return buf;
    }
},